package com.xing.book.service.impl;

import com.xing.book.dao.BookDao;
import com.xing.book.dao.impl.BookDaoImpl;
import com.xing.book.domin.Book;
import com.xing.book.service.BookService;

import java.util.List;


public class BookServiceImpl implements BookService {
    private BookDao bookDao=new BookDaoImpl();
    @Override
    public List<Book> findAll() {
        return bookDao.selectAll();
    }

    @Override
    public List<Book> findByTitle(String title) {
        return bookDao.selectByTitle(title);
    }

    @Override
    public void add(Book book) {
        bookDao.insert(book);
    }

    @Override
    public Book findById(int bookId) {
        return bookDao.selectById(bookId);
    }

    @Override
    public void modify(Book book) {
        bookDao.update(book);
    }

    @Override
    public void remove(int bookId) { //业务叫remove 数据库叫delete
        bookDao.delete(bookId);
    }


}
